﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RixRoverControl
{
    public partial class RixRoverControlForm : Form
    {
        RoverControl m_rover_control;

        public RixRoverControlForm( bool server )
        {
            InitializeComponent();

            if( server )
            {
                m_rover_control = new ArduinoControl();
            }
            else
            {
                m_rover_control = new TcpControl();
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            m_rover_control.update();
        }

        private void RixRoverControlForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            m_rover_control.close();
        }
    }
}
